package com.cn.wanxi.thread;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class MyTimer {
    public static void main(String[] args) throws ParseException {
//        final int[] a = {0};
        Timer timer = new Timer();
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat();

        timer.schedule(new TimerTask() {
            @Override
            public void run() {
//                System.out.println(a[0]++);
//                if (a[0] == 6) {
//                    System.out.println("定时器取消");
//                    timer.cancel();
//                }
            }
        }, 100);
    }
}
